<template>
    <div class="stat-card">
      <div class="label">{{ label }}</div>
      <div class="value">{{ value }}</div>
      <div class="delta">
        <span :class="up ? 'up' : 'down'">
          {{ up ? '↑' : '↓' }}{{ percent }}
        </span>
        <span class="sub">较上周</span>
      </div>
    </div>
  </template>
  
  <script setup>
  defineProps({
    label: String,
    value: [String, Number],
    percent: String,
    up: { type: Boolean, default: true },
  });
  </script>
  
  <style scoped>
  .stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    flex: 1;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  .label {
    color: #666;
    font-size: 14px;
  }
  .value {
    font-size: 28px;
    font-weight: 600;
    margin: 8px 0;
  }
  .delta {
    font-size: 13px;
  }
  .up   { color: #52c41a; }
  .down { color: #ff4d4f; }
  .sub  { color: #aaa; margin-left: 6px; }
  </style>